#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H

#include <QDialog>
#include "ui_LoginDialog.h"
#include "AuthClient.h"
#include "EmailSender.h"
#include "RegisterDialog.h"

class LoginDialog : public QDialog
{
    Q_OBJECT
public:
    explicit LoginDialog(AuthClient *authClient, EmailSender *emailSender, QWidget *parent = nullptr);
    bool isLoginSuccess() const;

private slots:
    void onLoginClicked();    // 登录逻辑
    void onRegisterClicked(); // 注册逻辑
    void onForgotPwdClicked();// 忘记密码逻辑

private:
    Ui::LoginDialog *ui;
    AuthClient *m_authClient;
    EmailSender *m_emailSender;
    bool m_loginSuccess = false;
};

#endif // LOGINDIALOG_H
